﻿using System.Collections.Generic;
using System.Linq;
using PortalWeb.CMS.Core.Entity;
using PortalWeb.CMS.Core.IManager;

namespace PortalWeb.CMS.Business
{
    public partial class CategoryManager : ICategoryManager
    {

        /// <summary>
        /// 获取跟栏目
        /// </summary>
        /// <returns></returns>
        public IEnumerable<Category> Root()
        {
            return Children(0);
        }

        public IEnumerable<Category> Children(int categoryId)
        {
            return base.BaseRepository.Find(p => p.ParentId == categoryId).OrderBy(c => c.Order);
        }
    }
}
